/**
 * Error
 * ----------------------------------------
 * 
 * - This class is used only for Struts 2.
 * - This class will inform errors and redirect to error page.
 * 
 * @author Caio Thomas
 * @version 28-10-2013
 */
package control;

public class Error {
	
	private String status;
	private String mensage;

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getMensage() {
		return mensage;
	}

	public void setMensage(String mensage) {
		this.mensage = mensage;
	}

	public String getTitle() {
		return "An error has occurred...";
	}

	public String execute() {
		int i = Integer.parseInt(this.status);
		
		switch(i) {
			
			case 1:		
				mensage = "We have error in edit constraint.";
				break;
				
			case 2:		
				mensage = "We have error in upload file xml. <br> Please, upload <strong>file</strong> again!";
				break;				
												
			default:
				mensage = "An error has occurred here, we will try to arrange!";
				break;	
		}	
		
		return "SUCCESS";
	}
}
